<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加栏目 - Powered By BETOU.NET</title>
<meta name="author" content="BETOU.NET Team" />
<meta name="copyright" content="BETOU.NET" />
<link href="${base}/res/betou/css/common.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${base}/res/common/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${base}/res/betou/js/jquery.tools.js" ></script>
<script type="text/javascript" src="${base}/res/betou/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/res/common/js/common.js"></script>
<script type="text/javascript" src="${base}/res/betou/js/input.js"></script>

<script type="text/javascript" src="${base}/thirdparty/editor/xheditor-1.2.1.min.js"></script>
<script type="text/javascript" src="${base}/thirdparty/editor/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript" src="${base}/thirdparty/editor/editor.js"></script>

<script type="text/javascript">
$(function() {
	var $browserButton = $("input.browserButton");
	var $inputForm = $("#inputForm");
	var $name = $("#name");
	var $shortName = $("#shortName");
	$name.blur( function(){
		$shortName.val( $(this).val( ));
	});
	// 表单验证
	$inputForm.validate({
		rules: {
			name:{required:true},
			priority:{required:true, digits:true}
		},
		message:{}
	});
	
});
function imageCallback( src, id ){
	var $titleForDiv = $("#title_" + id );
	var $inputForm = $("#inputForm");
	var $swfUpload = $("#" + id );
	var $titleImg = $("#titleImg");
	var hiddenTextId = "s_" + id;
	var $hiddenText = $("#" + hiddenTextId );
	var hiddenText = "<input type='hidden' id='" + hiddenTextId +"' value='" + src +"'/>";
	$inputForm.append( hiddenText );
	$titleForDiv.attr("title", "选择一张图片");
	$titleImg.val( src );
	
	$swfUpload.click( function( ){
		$("div[id*=SWFUpload]").each( function( i, e ){
			$(this).removeClass("orange");
		})
		
		$(this).addClass("orange");
		$titleImg.val( $hiddenText.val( ) );
	})
}
</script>
</head>
<body>
	<div class="path">
		<a href="../right.do">首页</a> &raquo; <a href="v_list.do"><@s.m "cmsTopic.function"/></a> &raquo; <@s.m "global.add"/>
	</div>
	<form id="inputForm" action="o_save.do" method="post" >
		<ul id="tab" class="tab">
			<li><input type="button" value="基本信息" /></li>
			<li><input type="button" value="SEO设置" /></li>
			<li><input type="button" value="图片上传" /></li>
			<li><input type="button" value="内容设置" /></li>
		</ul>
		<table class="input tabContent">
			<tr>
				<th><span class="requiredField">*</span><@s.m "cmsTopic.name"/>:</th>
				<td><input type="text"  name="name"  id="name" class="text" value="" maxlength="150" /></td>
			</tr>
			<tr>
				<th><@s.m "cmsTopic.shortName"/>:</th>
				<td><input type="text"  name="shortName"  id="shortName" class="text" value="" maxlength="150" title="<@s.m 'cmsTopic.shortName.help' />"/></td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span><@s.m "cmsTopic.priority"/>:</th>
				<td><input type="text"  name="priority"  class="text" value="10" maxlength="4" /></td>
			</tr>
			<tr>
				<th><@s.m "cmsTopic.recommend"/>:</th>
				<td>
					<label><input type="radio" name="recommend" value="true"  class="radio"/>是</label>
					<label><input type="radio" name="recommend" value="false"  class="radio" checked/>否</label>
				</td>
			</tr>
			<tr>
				<th><@s.m "cmsTopic.tplContent"/>:</th>
				<td>
					<select name="tplContent">
						<option value="">默认</option>
						<#list tplList as tpl>
							<option value="${tpl}">${tpl}</option>
						</#list>
					</select>
				</td>
			</tr>
			<tr>
				<th><@s.m "cmsTopic.channel"/>:</th>
				<td>
					<select name="channelId">
						<option value="" >所有栏目</option>
						<#list channelList as item>
							<option value="${item.id}" >
							<#if item.deep gt 0><#list 1..item.deep as x>&nbsp; </#list>&gt;</#if>${item.name!}
							</option>
						</#list>
					</select>
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th><@s.m "cmsTopic.keywords"/>:</th>
				<td><input type="text"  name="keywords"  class="text" value="" maxlength="150" /></td>
			</tr>
			<tr>
				<th><@s.m "cmsTopic.description"/>:</th>
				<td>
					<textarea class="text" name="description"></textarea>
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th>标题图:</th>
				<td>
					<input type="text" name="titleImg" id="titleImg" class="text" style="width:300px" title="可以直接填写网络图片地址"/>
				</td>
			</tr>
			<tr>
				<th></th>
				<td>
						<#include "/common/image_swfupload.html"/>
				</td>
			</tr>
		</table>
		<table class="input tabContent">
			<tr>
				<th>内容:</th>
				<td>
						<textarea class="text" name="content" id="content" class="xheditor"></textarea>
						<script type="text/javascript">
						$('#content').xheditor({
							width:800,height:400,linkTag:true,showBlocktag:false,internalScript:false,inlineScript:false,internalStyle:false,
							inlineStyle:false,disableContextmenu: true,html5Upload:false,upImgUrl:"../common/o_xheditor_upload_image.do",upImgExt:"jpg,jpeg,gif,png"
							});
						</script>
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>&nbsp;</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
					<input type="button" class="button" value="返&nbsp;&nbsp;回" onclick="location.href='v_list.do'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
